<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
	<meta name="description" content="description"/>
	<meta name="keywords" content="keywords"/>
  <meta name="author" content="Kyle Yetter"/>
	<link rel="stylesheet" type="text/css" href="stylesheets/article.css" media="screen"/>
  <link rel="stylesheet" type="text/css" href="stylesheets/generic.css" media="screen"/>

	<title>ANTLR For Ruby: Built-In Drivers</title>
</head>

<body>
<div class="left">
	<div class="header">
		<h2><span>ANTLR for Ruby</span></h2>
		<h1>Built-In Drivers</h1>
	</div>
	<div class="annotation">
		<div class="author">by <a href="mailto:kcy5b@yahoo.com">Kyle Yetter</a></div>
    <div class="timestamp">updated Sunday, August 04, 2013 at 09:59PM EDT</div>
	</div>
	<div class="content">
<p>As an additional feature to speed up the grammar development process, each generated recognizer class produced by <code>antlr4ruby</code> includes a built in driver program. Thus, when the generated file is run directly as a ruby script, it will behave as a command line application that may be used to parse given source input for the language. The driver code is never executed when the recognizer is loaded as a library via <code>require</code> or <code>load</code>; the driver code is guarded with a standard <code>if $0 == __FILE__</code> block.</p>
<h2>Sample Usage</h2>
<p>To demonstrate how this built-in driver feature could be used, imagine developing a grammar to recognize <acronym title="Cascading Style Sheets"><span class="caps">CSS</span></acronym>. You have written a combined grammar file, <code>CSS.g</code>, and you have some sample <span class="caps">CSS</span> source code in a file, <code>sample.css</code>.</p>
<div class="naked-code-frame">
  <div class="code-header">sample.css</div>
  <table class="generic" id="css70001867678020">
  <tr class="code_line" id="css70001867678020-1">
    <td class="code"><pre><span class="c">/*&nbsp;super&nbsp;grey&nbsp;paragraphs&nbsp;*/</span><span class="tx"></span></pre></td>
  </tr>
  <tr class="code_line" id="css70001867678020-2">
    <td class="code"><pre><span class="nt">p</span><span class="tx">&nbsp;</span><span class="p">{</span><span class="tx"></span></pre></td>
  </tr>
  <tr class="code_line" id="css70001867678020-3">
    <td class="code"><pre><span class="tx">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="k">left</span><span class="o">-</span><span class="k">margin</span><span class="o">:</span><span class="tx">&nbsp;</span><span class="m">10px</span><span class="p">;</span><span class="tx"></span></pre></td>
  </tr>
  <tr class="code_line" id="css70001867678020-4">
    <td class="code"><pre><span class="tx">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="k">background</span><span class="o">:</span><span class="tx">&nbsp;</span><span class="m">#EEEEEE</span><span class="p">;</span><span class="tx"></span></pre></td>
  </tr>
  <tr class="code_line" id="css70001867678020-5">
    <td class="code"><pre><span class="p">}</span><span class="tx"></span></pre></td>
  </tr>
  <tr class="code_line" id="css70001867678020-6">
    <td class="code"><pre></pre></td>
  </tr>
</table>

</div>
<p>Generate the ruby recognizer files, <code>CSSLexer.rb</code> and <code>CSSParser.rb</code>:</p>
<div class="naked-code-frame">
  <table class="generic" id="70001867706960">
  <tr class="code_line" id="70001867706960-1">
    <td class="code"><pre><span class="gp">~&gt;</span><span class="w">&nbsp;</span><span class="ni">antlr4ruby</span><span class="w">&nbsp;</span><span class="ss">-fo</span><span class="w">&nbsp;</span><span class="nv">CSS</span><span class="w">&nbsp;</span><span class="nv">CSS.g</span></pre></td>
  </tr>
</table>

</div>
<p>Now, if you just want to get a quick sense of how the recognizers function, you do not need to go through the extra trouble of writing a driver for the recognizer classes. You can simply run the script with <code>sample.css</code> as an argument:</p>
<div class="code-frame">
  <div class="code-header">Using the Built-In Lexer Driver Script to See How <code>sample.css</code> Is Tokenized</div>
  <table class="generic" id="70001867718320">
  <tr class="code_line" id="70001867718320-1">
    <td class="code"><pre><span class="gp">~&gt;</span><span class="w">&nbsp;</span><span class="ni">ruby</span><span class="w">&nbsp;</span><span class="nv">CSS/CSSLexer.rb</span><span class="w">&nbsp;</span><span class="nv">CSS/sample.css</span><span class="kp"></span></pre></td>
  </tr>
  <tr class="code_line" id="70001867718320-2">
    <td class="code"><pre><span class="go">#&nbsp;&nbsp;&nbsp;COMMENT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;/*&nbsp;super&nbsp;grey&nbsp;paragraphs&nbsp;*/&quot;&nbsp;@&nbsp;line&nbsp;1&nbsp;&nbsp;&nbsp;col&nbsp;0&nbsp;&nbsp;&nbsp;(hidden)</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867718320-3">
    <td class="code"><pre><span class="go">--&gt;&nbsp;WS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;\n&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@&nbsp;line&nbsp;1&nbsp;&nbsp;&nbsp;col&nbsp;27</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867718320-4">
    <td class="code"><pre><span class="go">--&gt;&nbsp;ID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;p&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@&nbsp;line&nbsp;2&nbsp;&nbsp;&nbsp;col&nbsp;0</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867718320-5">
    <td class="code"><pre><span class="go">--&gt;&nbsp;WS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;&nbsp;&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@&nbsp;line&nbsp;2&nbsp;&nbsp;&nbsp;col&nbsp;1</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867718320-6">
    <td class="code"><pre><span class="go">--&gt;&nbsp;T__41&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;{&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@&nbsp;line&nbsp;2&nbsp;&nbsp;&nbsp;col&nbsp;2</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867718320-7">
    <td class="code"><pre><span class="go">--&gt;&nbsp;WS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;\n&nbsp;&nbsp;&nbsp;&nbsp;&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@&nbsp;line&nbsp;2&nbsp;&nbsp;&nbsp;col&nbsp;3</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867718320-8">
    <td class="code"><pre><span class="go">--&gt;&nbsp;ID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;left-margin&quot;&nbsp;&nbsp;&nbsp;@&nbsp;line&nbsp;3&nbsp;&nbsp;&nbsp;col&nbsp;4</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867718320-9">
    <td class="code"><pre><span class="go">--&gt;&nbsp;T__45&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;:&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@&nbsp;line&nbsp;3&nbsp;&nbsp;&nbsp;col&nbsp;15</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867718320-10">
    <td class="code"><pre><span class="go">--&gt;&nbsp;WS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;&nbsp;&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@&nbsp;line&nbsp;3&nbsp;&nbsp;&nbsp;col&nbsp;16</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867718320-11">
    <td class="code"><pre><span class="go">--&gt;&nbsp;LENGTH&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;10px&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@&nbsp;line&nbsp;3&nbsp;&nbsp;&nbsp;col&nbsp;17</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867718320-12">
    <td class="code"><pre><span class="go">--&gt;&nbsp;T__38&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;;&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@&nbsp;line&nbsp;3&nbsp;&nbsp;&nbsp;col&nbsp;21</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867718320-13">
    <td class="code"><pre><span class="go">--&gt;&nbsp;WS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;\n&nbsp;&nbsp;&nbsp;&nbsp;&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@&nbsp;line&nbsp;3&nbsp;&nbsp;&nbsp;col&nbsp;22</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867718320-14">
    <td class="code"><pre><span class="go">--&gt;&nbsp;ID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;background&quot;&nbsp;&nbsp;&nbsp;&nbsp;@&nbsp;line&nbsp;4&nbsp;&nbsp;&nbsp;col&nbsp;4</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867718320-15">
    <td class="code"><pre><span class="go">--&gt;&nbsp;T__45&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;:&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@&nbsp;line&nbsp;4&nbsp;&nbsp;&nbsp;col&nbsp;14</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867718320-16">
    <td class="code"><pre><span class="go">--&gt;&nbsp;WS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;&nbsp;&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@&nbsp;line&nbsp;4&nbsp;&nbsp;&nbsp;col&nbsp;15</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867718320-17">
    <td class="code"><pre><span class="go">--&gt;&nbsp;HASH&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;#EEEEEE&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@&nbsp;line&nbsp;4&nbsp;&nbsp;&nbsp;col&nbsp;16</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867718320-18">
    <td class="code"><pre><span class="go">--&gt;&nbsp;T__38&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;;&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@&nbsp;line&nbsp;4&nbsp;&nbsp;&nbsp;col&nbsp;23</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867718320-19">
    <td class="code"><pre><span class="go">--&gt;&nbsp;WS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;\n&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@&nbsp;line&nbsp;4&nbsp;&nbsp;&nbsp;col&nbsp;24</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867718320-20">
    <td class="code"><pre><span class="go">--&gt;&nbsp;T__42&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;}&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@&nbsp;line&nbsp;5&nbsp;&nbsp;&nbsp;col&nbsp;0</span></pre></td>
  </tr>
</table>

</div>
<p>As shown above, the lexer driver will tokenize the input source file and display each token on a single line. You can also try out the parser, though, by default, the output is much more minimal if the source code does not have any recognition errors. However, if the source has improper syntax, the recognition errors will be displayed.</p>
<div class="code-frame">
  <div class="code-header">Using the Built-In Parser Driver Script to Check Input For Recognition Errors</div>
  <table class="generic" id="70001867733360">
  <tr class="code_line" id="70001867733360-1">
    <td class="code"><pre><span class="gp">~&gt;</span><span class="w">&nbsp;</span><span class="ni">ruby</span><span class="w">&nbsp;</span><span class="nv">CSS/CSSParser.rb</span><span class="w">&nbsp;</span><span class="nv">sample.css</span><span class="kp"></span></pre></td>
  </tr>
  <tr class="code_line" id="70001867733360-2">
    <td class="code"><pre><span class="gp">~&gt;</span><span class="w">&nbsp;</span><span class="ni">ruby</span><span class="w">&nbsp;</span><span class="nv">CSS/CSSParser.rb</span><span class="w">&nbsp;</span><span class="ss">-i</span><span class="w">&nbsp;</span><span class="s">&quot;p&nbsp;{&nbsp;/*&nbsp;incomplete&nbsp;*/&quot;</span><span class="kp"></span></pre></td>
  </tr>
  <tr class="code_line" id="70001867733360-3">
    <td class="code"><pre><span class="go">line&nbsp;0:-1&nbsp;mismatched&nbsp;input&nbsp;&quot;&lt;EOF&gt;&quot;&nbsp;expecting&nbsp;&#39;}&#39;</span></pre></td>
  </tr>
</table>

</div>
<h1 id="section-1">Lexer Drivers</h1>
<div class="code-frame">
  <table class="generic" id="70001867736540">
  <tr class="code_line" id="70001867736540-1">
    <td class="code"><pre><span class="gp">~&gt;</span><span class="w">&nbsp;</span><span class="ni">ruby</span><span class="w">&nbsp;</span><span class="nv">CSS/CSSLexer.rb</span><span class="w">&nbsp;</span><span class="ss">--help</span><span class="kp"></span></pre></td>
  </tr>
  <tr class="code_line" id="70001867736540-2">
    <td class="code"><pre><span class="go">Usage:&nbsp;CSSLexer&nbsp;[options]</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867736540-3">
    <td class="code"><pre><span class="go">Input&nbsp;Options:</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867736540-4">
    <td class="code"><pre><span class="go">&nbsp;&nbsp;&nbsp;&nbsp;-i,&nbsp;--input&nbsp;&quot;text&nbsp;to&nbsp;process&quot;&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;string&nbsp;to&nbsp;use&nbsp;as&nbsp;direct&nbsp;input&nbsp;to&nbsp;the&nbsp;recognizer</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867736540-5">
    <td class="code"><pre><span class="go">&nbsp;&nbsp;&nbsp;&nbsp;-I,&nbsp;--interactive&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;run&nbsp;an&nbsp;interactive&nbsp;session&nbsp;with&nbsp;the&nbsp;recognizer</span></pre></td>
  </tr>
</table>

</div>
<h1 id="section-2">Parser Drivers</h1>
<div class="code-frame">
  <table class="generic" id="70001867744840">
  <tr class="code_line" id="70001867744840-1">
    <td class="code"><pre><span class="gp">~&gt;</span><span class="w">&nbsp;</span><span class="ni">ruby</span><span class="w">&nbsp;</span><span class="nv">CSS/CSSParser.rb</span><span class="w">&nbsp;</span><span class="ss">--help</span><span class="kp"></span></pre></td>
  </tr>
  <tr class="code_line" id="70001867744840-2">
    <td class="code"><pre><span class="go">Usage:&nbsp;CSSParser&nbsp;[options]</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867744840-3">
    <td class="code"><pre><span class="go">Input&nbsp;Options:</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867744840-4">
    <td class="code"><pre><span class="go">&nbsp;&nbsp;&nbsp;&nbsp;-i,&nbsp;--input&nbsp;&quot;text&nbsp;to&nbsp;process&quot;&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;string&nbsp;to&nbsp;use&nbsp;as&nbsp;direct&nbsp;input&nbsp;to&nbsp;the&nbsp;recognizer</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867744840-5">
    <td class="code"><pre><span class="go">&nbsp;&nbsp;&nbsp;&nbsp;-I,&nbsp;--interactive&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;run&nbsp;an&nbsp;interactive&nbsp;session&nbsp;with&nbsp;the&nbsp;recognizer</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867744840-6">
    <td class="code"><pre><span class="go"></span></pre></td>
  </tr>
  <tr class="code_line" id="70001867744840-7">
    <td class="code"><pre><span class="go">Parser&nbsp;Configuration:</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867744840-8">
    <td class="code"><pre><span class="go">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--lexer-name&nbsp;CLASS_NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name&nbsp;of&nbsp;the&nbsp;lexer&nbsp;class&nbsp;to&nbsp;use</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867744840-9">
    <td class="code"><pre><span class="go">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--lexer-file&nbsp;PATH_TO_LIBRARY&nbsp;path&nbsp;to&nbsp;library&nbsp;defining&nbsp;the&nbsp;lexer&nbsp;class</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867744840-10">
    <td class="code"><pre><span class="go">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--rule&nbsp;NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name&nbsp;of&nbsp;the&nbsp;parser&nbsp;rule&nbsp;to&nbsp;execute</span></pre></td>
  </tr>
</table>

</div>
<h1 id="section-3">Tree Parser Drivers</h1>
<div class="code-frame">
  <table class="generic" id="70001867752460">
  <tr class="code_line" id="70001867752460-1">
    <td class="code"><pre><span class="gp">~&gt;</span><span class="w">&nbsp;</span><span class="ni">ruby</span><span class="w">&nbsp;</span><span class="nv">CSS/CSSWalker.rb</span><span class="w">&nbsp;</span><span class="ss">--help</span><span class="kp"></span></pre></td>
  </tr>
  <tr class="code_line" id="70001867752460-2">
    <td class="code"><pre><span class="go">Usage:&nbsp;FlatListWalker&nbsp;[options]</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867752460-3">
    <td class="code"><pre><span class="go">Input&nbsp;Options:</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867752460-4">
    <td class="code"><pre><span class="go">&nbsp;&nbsp;&nbsp;&nbsp;-i,&nbsp;--input&nbsp;&quot;text&nbsp;to&nbsp;process&quot;&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;string&nbsp;to&nbsp;use&nbsp;as&nbsp;direct&nbsp;input&nbsp;to&nbsp;the&nbsp;recognizer</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867752460-5">
    <td class="code"><pre><span class="go">&nbsp;&nbsp;&nbsp;&nbsp;-I,&nbsp;--interactive&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;run&nbsp;an&nbsp;interactive&nbsp;session&nbsp;with&nbsp;the&nbsp;recognizer</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867752460-6">
    <td class="code"><pre><span class="go"></span></pre></td>
  </tr>
  <tr class="code_line" id="70001867752460-7">
    <td class="code"><pre><span class="go">Tree&nbsp;Parser&nbsp;Configuration:</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867752460-8">
    <td class="code"><pre><span class="go">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--lexer-name&nbsp;CLASS_NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;full&nbsp;name&nbsp;of&nbsp;the&nbsp;lexer&nbsp;class&nbsp;to&nbsp;use</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867752460-9">
    <td class="code"><pre><span class="go">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--lexer-file&nbsp;PATH_TO_LIBRARY&nbsp;path&nbsp;to&nbsp;load&nbsp;to&nbsp;make&nbsp;the&nbsp;lexer&nbsp;class&nbsp;available</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867752460-10">
    <td class="code"><pre><span class="go">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--parser-name&nbsp;CLASS_NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;full&nbsp;name&nbsp;of&nbsp;the&nbsp;parser&nbsp;class&nbsp;to&nbsp;use</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867752460-11">
    <td class="code"><pre><span class="go">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--parser-file&nbsp;PATH_TO_LIBRARY</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867752460-12">
    <td class="code"><pre><span class="go">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;path&nbsp;to&nbsp;load&nbsp;to&nbsp;make&nbsp;the&nbsp;parser&nbsp;class&nbsp;available</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867752460-13">
    <td class="code"><pre><span class="go">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--parser-rule&nbsp;NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name&nbsp;of&nbsp;the&nbsp;parser&nbsp;rule&nbsp;to&nbsp;use&nbsp;on&nbsp;the&nbsp;input</span></pre></td>
  </tr>
  <tr class="code_line" id="70001867752460-14">
    <td class="code"><pre><span class="go">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--rule&nbsp;NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name&nbsp;of&nbsp;the&nbsp;rule&nbsp;to&nbsp;invoke&nbsp;in&nbsp;the&nbsp;tree&nbsp;parser</span></pre></td>
  </tr>
</table>

</div>
	</div>
</div>

<div class="nav">
	<div class="logo"><span></span></div>

	<ul>
		<li><a href="#section-1">Lexer Drivers</a></li>
		<li><a href="#section-2">Parser Drivers</a></li>
		<li><a href="#section-3">Tree Parser Drivers</a></li>
	</ul>
</div>

<div class="right">
	<div class="round">		
		<div class="roundtl"><span></span></div>
		<div class="roundtr"><span></span></div>
		<div class="clearer"><span></span></div>
	</div>

	<div class="subnav">
		<h1>Contents</h1>
		<ul>
      <li><a href="./index.html">Home</a></li>
      <li><a href="./GettingStarted.html">Getting Started</a></li>
      <li><a href="./Lexers.html">Lexers</a></li>
      <li><a href="./Parsers.html">Parsers</a></li>
      <li><a href="./Tokens.html">Tokens</a></li>
      <li><a href="./ActionBlocks.html">Action Blocks</a></li>
      <li><a href="./Scopes.html">Scopes</a></li>
      <li class="todo"><a href="./TreeParsers.html">Tree Parsers</a></li>
      <li class="todo"><a href="./ASTs.html">Abstract Syntax Trees</a></li>
  		<li class="current">Built-In Drivers</li>
      <li class="todo"><a href="./TemplateMode.html">Template Mode</a></li>
      <li class="todo"><a href="./DebugMode.html">Debug Mode</a></li>
      <li class="todo"><a href="./ProfileMode.html">Profile Mode</a></li>
      <li class="todo"><a href="./Extras.html">Extras</a></li>
		</ul>
		
    <h1>Project Links</h1>
		<ul>
      <li><a href="http://github.com/ohboyohboyohboy/antlr3">GitHub</a></li>
      <li><a href="http://rubygems.org/gems/antlr3">Ruby Gems</a></li>
      <li><a href="http://rubyforge.org/projects/antlr3">Rubyforge</a></li>
      <li><a href="http://github.com/ohboyohboyohboy/antlr3/issues">Bug Reports</a></li>
		</ul>
		
    <h1>External Links</h1>
		<ul>
      <li><a href="http://www.antlr.org">ANTLR.org</a></li>
      <li><a href="http://www.antlr.org/wiki/display/ANTLR3/ANTLR+Cheat+Sheet">ANTLR Cheat Sheet</a></li>
      <li><a href="http://www.antlr.org/wiki/display/ANTLR3/ANTLR+v3+documentation">ANTLR Documentation</a></li>
      <li><a href="http://www.antlr.org/grammar/list">Sample Grammar Exchange</a></li>
		</ul>
	</div>

	<div class="round">
		<div class="roundbl"><span></span></div>
		<div class="roundbr"><span></span></div>
		<span class="clearer"></span>
	</div>
</div>

<div class="footer">
	
  &copy; 2010 <a href="mailto:kcy5b@yahoo.com">Kyle Yetter</a>. Valid <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a> &amp; <a href="http://validator.w3.org/check?uri=referer">XHTML</a>. <a href="http://templates.arcsin.se">Website template</a> by <a href="http://arcsin.se">Arcsin</a>

</div>
</body>

</html>